/*
*类描述：banner管理类
*开发者：sjc
*创建时间：2018-8-17 14:42:36
*/
var columns = [
	{
        field: 'index',
        title: '序号',
        align:"center",
        formatter: function (value, row, index) {
            return index + 1 + (row.pageNumber - 1) * row.pageSize;
        }
},{
    field: 'bannerName',
        align: 'center',
    title: 'banner名称',
    sortable: true
},{
        field: 'bannerType',
        title: 'banner类型',
        align: 'center',
        sortable: true
    },{
        field: 'state',
        title: '是否启用',
        align: 'center',
        formatter: function (value, row, index) {
            return pubSwitch.getSwitchBtnCss(row);
        }
    },{
        field: 'operator',
        title: '操作',
        align: 'center',
        formatter: function (value, row, index) {
            return pubOptBtn.getOptBtn('bannerManage',menu,row.id);
        }
}];

var bannerManage={
   bannerInit:function () {
       pubOptBtn.getHeadBtn("p","#toolbar","bannerManage",menu);
       pubForm.getBootTable("#banner_table","/query/queryBanner","/banner/updateBannerState");
   } ,
    openAddBanner:function () {
        loadUtil = new Load($);
        loadUtil.load({
            container:'#homeContent',
            url: application.contextPath+"/banner/openAddBanner"
        });
    },
    showBannerInfo:function (id) {
        loadUtil = new Load($);
        loadUtil.load({
            container:'#homeContent',
            url: application.contextPath+"/banner/showBannerInfo?bnId="+id
        });
    },
    toEditBanner:function (id) {
        loadUtil = new Load($);
        loadUtil.load({
            container:'#homeContent',
            url: application.contextPath+"/banner/toEditBanner?bnId="+id
        });
    },
    delBanner:function (id) {
        pubForm.delRow(id,"/banner/delBanner","/query/queryBanner","#banner_table");
    }
};

$(document).ready(function(){
    bannerManage.bannerInit();
});